home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / c / vbcc_grexx.lha / vc.ged < prev   
Encoding:
Text File  |  1997-07-08  |  2.9 KB  |  110 lines

  1. /* 
  2. ** This script was written by me, so I could compile stuff useing vbcc
  3. ** through GoldEd.  I converted this Script from a Script file written to
  4. ** compile stuff useing gcc through GoldEd.  I truly hope the original
  5. ** author does not mind this.  I hope that whoever finds this script
  6. ** finds it useful in glueing together a truly cool compiler like vbcc and
  7. ** a killer Editor like GoldEd.  If you have any problems running this
  8. ** script, try messing with it a little, it's pretty strait forward and
  9. ** can be modified with little effort.  I of course take no liability for
  10. ** anything this script might do to your computer.  (Yeah like a rexx
  11. ** script is gonna do somethin catostrauphic).  I thought that I'de
  12. ** mention it so I don't get blamed for the end of the world when the
  13. ** highly improbable does happen.  My thanks to Volker Barthelmann for
  14. ** writeing vbcc.  Hope you enjoy useing Golded with vbcc
  15. **
  16. **                           Sincerely,
  17. **                               Harlock
  18. **
  19. */ 
  20.  
  21.  
  22.  
  23. OPTIONS RESULTS                             /* enable return codes     */
  24.  
  25. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  26.     address 'GOLDED.1'
  27.  
  28. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  29. OPTIONS FAILAT 6                            /* ignore warnings         */
  30. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  31.  
  32. host = ADDRESS()                              /* get GED's port    */
  33.  
  34. /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
  35.  
  36. options results
  37. parse arg COM
  38.  
  39.           COM = "vc"
  40.  
  41. 'QUERY CAT'
  42.  
  43. 'QUERY ANYTEXT'
  44.  
  45. if (result = 'TRUE') then 
  46.  
  47.     do
  48.         'QUERY DOC VAR OLDNAME'             /* remember current file name */
  49.         
  50.         'QUERY PATH Var PFAD'
  51.         'QUERY FILE VAR FNAME'              
  52.  
  53.         Name = left(FNAME, Pos('.', FNAME) - 1)
  54.  
  55.         if right(PFAD,1) = ":" then NameB = PFAD || Name
  56.            else NameB = PFAD || '/' || Name
  57.  
  58.         Code = EXISTS(Code)
  59.  
  60.         'SAVE ALL'
  61.  
  62.         say
  63.         say COM '-+' OLDNAME '-o' NameB
  64.         say
  65.  
  66.         shell
  67.         call pragma 'Stack', 250000
  68.         COM '-+' OLDNAME '-o' NameB
  69.  
  70.         ok = (RC = 0)
  71.  
  72.         shell                               /* address host (GoldED) */
  73.  
  74.         'REQUEST BODY="Compilation Complete. Run program ?" BUTTON="_run|_cancel"'
  75.  
  76.         if (result = 1) then do
  77.  
  78.             'QUERY CON VAR CON'
  79.  
  80.             shell
  81.             run NameB || ' > ' || CON
  82.             shell
  83.  
  84.         end
  85.  
  86.         'NAME NEW ' || oldname              /* restore old file name */
  87.     end
  88.  
  89. else do
  90.  
  91.     'REQUEST BODY="Text buffer is empty ?!"'
  92. end
  93.  
  94. 'UNLOCK' /* VERY important: unlock GUI */
  95. Exit
  96.  
  97.   GetFile:PROCEDURE
  98.  
  99.     ARG envv
  100.  
  101.     filename= envv
  102.     IF OPEN(fhandle,filename,"READ") THEN DO
  103.       readed=READLN(fhandle);
  104.       CALL CLOSE(fhandle);
  105.     END;
  106.     ELSE readed = "unset"
  107.  
  108.     RETURN readed
  109.  
  110.